package com.net

import com.base.AppConfig
import com.somlsis.bean.Upload
import com.somlsis.bean.User
import com.somlsis.bean.UserOverview
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface QueryInterface {
    @GET(AppConfig.SMSCODE)
    open fun getSMSCode(
        @Query("phone") phone: String,
        @Query("key") key: String
    ): Call<HttpResponse<String>>

    @POST(AppConfig.LOGIN)
    open fun loginForCode(
        @Query("phone") phone: String,
        @Query("key") key: String,
        @Query("code") code: String
    ): Call<HttpResponse<User>>

    @POST(AppConfig.LOGIN)
    open fun loginForPwd(
        @Query("phone") phone: String,
        @Query("key") key: String,
        @Query("pwd") pwd: String
    ): Call<HttpResponse<User>>

    @POST(AppConfig.OVERVIEW)
    open fun getUserOverview(
        @Query("uid") uid: String
    ): Call<HttpResponse<UserOverview>>

    @POST(AppConfig.STORE)
    open fun store(
        @Query("uid") uid: String, @Query("record") record: String
    ): Call<HttpResponse<String>>

    @POST(AppConfig.FEEDBACK)
    open fun submitFeedback(
        @Query("uid") uid: String,
        @Query("type") type: String,
        @Query("content") content: String,
        @Query("link") link: String,
        @Query("img") record: ArrayList<String>
    ): Call<HttpResponse<String>>

    @POST(AppConfig.UPLOAD)
    open fun upload(
        @Query("pic") base64: String
    ): Call<HttpResponse<Upload>>

    @POST(AppConfig.EDIT_USER)
    open fun editUser(
        @Query("uid") uid: String,
        @Query("name") name: String,
        @Query("avatar") avatar: String,
        @Query("birth") birth: String,
        @Query("sex") sex: String,
        @Query("height") height: String,
        @Query("weight") weight: String
    ): Call<HttpResponse<User>>

    @POST(AppConfig.BINDING_DEVICE)
    open fun bindingDevice(
        @Query("uid") uid: String,
        @Query("serial_name") serialName: String,
        @Query("serial_mac") serialMac: String,
        @Query("serial_type") serialType: String,
        @Query("serial_num") serialNum: String,
        @Query("serial_version") serialVersion: String,
        @Query("device_version") deviceVersion: String,
    ): Call<HttpResponse<String>>

    @POST(AppConfig.LIST_DEVICE)
    open fun getDeviceList(
        @Query("uid") uid: String
    ): Call<HttpResponse<ArrayList<DeviceNet>>>
}